const px2vw=require('postcss-px-to-viewport');
module.exports = {
   devServer: {//配置代理
    proxy: {
      //请求路径当中包含 /api
      '/api': {
        //代理的目标地址
        target: 'http://localhost:3000/',
        // 是否允许跨域
        changeOrigin: true,
        //路径的重写
        pathRewrite: {
          '^/api': '' // rewrite path
        }
      },
      '/ajax': {
        //代理的目标地址
        target: 'https://m.maoyan.com',
        changeOrigin: true,
      }
    }
  },
css: {
    loaderOptions: {
      postcss:{
        plugins:[px2vw({
          unitToConvert: 'px',
          viewportWidth: 375,
          unitPrecision: 5,
          propList: ['*'],
          viewportUnit: 'vw',
          fontViewportUnit: 'vw',
          selectorBlackList: [],
          minPixelValue: 1,
          mediaQuery: false,
          replace: true,
          exclude: [/node_modules/],
          include: undefined,
          landscape: false,
          landscapeUnit: 'vw',
          landscapeWidth: 568
        })]
      }
    }
 }
}